# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

pkgname=signon-plugin-oauth2
_pkgname=signon-oauth2
pkgver=0.25
pkgrel=1
pkgdesc='OAuth 2 plugin for signon'
arch=(x86_64)
url='https://gitlab.com/accounts-sso/signon-plugin-oauth2'
license=(LGPL)
depends=(signond)
makedepends=(qt5-xmlpatterns)
source=(https://gitlab.com/accounts-sso/signon-plugin-oauth2/-/archive/VERSION_$pkgver/signon-plugin-oauth2-VERSION_$pkgver.tar.bz2)
sha256sums=('04ce8d84f2beb29ca86399794519c2d0bbecf7c428fd9e6c01d7f3614a9ba98e')

prepare() {
  cd $pkgname-VERSION_$pkgver

  sed -i '/-Werror/d' common-project-config.pri

  # Do not install tests and example
  echo 'INSTALLS =' >>tests/tests.pro
  echo 'INSTALLS =' >>example/example.pro
}

build() {
  cd $pkgname-VERSION_$pkgver

  qmake-qt5 PREFIX=/usr LIBDIR=/usr/lib
  make
}

package() {
  cd $pkgname-VERSION_$pkgver

  make INSTALL_ROOT="$pkgdir" install
}
